-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditionally add monitoring structure to top-level of output in API #11106
Conversation
I ran this PR locally and it works as expected. So I think this is definitely going in the right direction! A couple of thoughts, mostly around where the new field should go in the API response body:
[EDIT] I don't have strong preferences about these options. I think it might be good to get someone from Logstash core to weigh in on this whenever the PR is ready for review.
This is correct. If the key is present, Metricbeat will consume it and use it's value as the value of the |
@jsvd Any thoughts on the comments from @ycombinator above? I don't think I have particularly strong opinions, either. I could really live with any of the excellent options outlined by @ycombinator. If I had to choose, I'd maybe pick a settings key in the top-level of the return structure where we could put this type of data but I can live with any of the options. |
Bump @jsvd . Thanks! |
if we're only planning to add this cluster_uuid then I'd probably put it alongside the node uuid and other more static information inside the node info (/_node) api, something like:
I am adding the "monitoring" namespace as I'm concerned about naming here, as this can mislead folks into thinking their logstashes are clustered in some way. Not necessary for this iteration, but since we're adding this cluster uuid return through the api, could we also report a few other details like host and user (not password)? having these would make it clearer that the cluster uuid refers to the ES cluster for monitoring:
|
@ycombinator and @jsvd I've pushed up some changes to incorporate the feedback. Let me know what you think. Thanks! |
I just pulled down this PR and ran the following Logstash pipeline with it:
A couple of observations:
The same error is also shown in the Logstash server logs. |
ae08581
to
ab8efdb
Compare
@ycombinator I've addressed both issues that you reported. (Thanks for finding it!) However, I'd like to add more testing around this before taking it out of |
Thanks @cachedout. I'll wait to do the next round of review until this PR is in "Ready for Review" state, since we're expecting more changes/additions to this PR. |
@jsvd I could use some help on this one. I've tried a couple different approaches to temporarily setting a settings value (https://github.com/elastic/logstash/pull/11106/files#diff-430ede93a6bae9fb57425ef58be7186fR24) and no matter what, tests fail on the setting not being registered, even when I explicitly register it after each test. Do you know what's going on here? |
Hi again @jsvd. Any chance we could carve out a little time to try to figure out what's going on with these tests? I've hit a dead end. |
Hi @jsvd. Just checking if you might have some time in the coming days to assist with this. Thanks! |
Hi again @jsvd. Is there anybody on the LS team who might be able to spare a little time to help out here? Thanks. :) |
@jsvd I suspect the @elastic/stack-monitoring team is still looking for this to get in at some point. I'm happy to take some time to help get this finished but will need some help from the LS folks since I'm at a loss to explain this test failure, I'm afraid. |
Pinged Logstash team in Slack and awaiting a response. |
Jenkins test this please |
@cachedout @andsel will be looking into this PR, we will target this for 7.7. Let me know if there's anything else you need? |
@@ -12,9 +12,27 @@ | |||
|
|||
let(:report_class) { described_class } | |||
|
|||
after :each do | |||
LogStash::SETTINGS.register(LogStash::Setting::Boolean.new("xpack.monitoring.enabled", false)) unless LogStash::SETTINGS.registered?("xpack.monitoring.enabled") | |||
LogStash::SETTINGS.reset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogStash::SETTINGS
is a singleton instance in the LogStash module, the reset
operation nullify all the values in the collection, perhaps could be best to have a logic of save-before test restore-after for only the settings used by this test
Jenkins test this |
Fixed the build and tested locally. So for me is ready for review |
In terms of the HTTP API changes, this PR works as expected. However, I'm noticing another issue. Let's say I have the following configuration in
And let's say I'm running this pipeline:
Because However, the use case for this PR is for Metricbeat to be able to externally monitor a Logstash node by calling various Logstash HTTP APIs. So, in such a scenario, we wouldn't want Logstash itself also sending data to the monitoring Elasticsearch cluster. Would it be possible to expose the value from the |
Also, we should probably update this doc to mention this new setting, either as part of this PR itself or a follow up PR? In the Beats docs, we document this setting like so:
Of course, in Logstash the setting is under the |
I agree with you @ycombinator it's not correct to enable
|
I like @andsel's proposal. It will make the setting name for the cluster UUID, |
@ycombinator I've integrated the your suggested changes. Updated the doc with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally LGTM!
@andsel Feel free to merge this when you think it's ready. :) |
…e stats HTTP API Fixes #11106
I think PR is causing parity test failures: https://internal-ci.elastic.co/job/elastic+estf-monitoring-snapshots+master+multijob-logstash/78/console It looks like the monitoring documents collected by Metricbeat contain (via the |
Thanks @chrisronline. Given what you've described, I think the fix for this needs to go into the Metricbeat |
@chrisronline PR is up: elastic/beats#16198. Could you functionally review it when you get a chance, please? Thanks! |
Refs: #11066
Adds a new setting to Logstash called
xpack.monitoring.cluster_uuid
. If the setting is discovered to be set by the user, it is added to the top-level of API responses.@ycombinator I have included instructions below for you to have a look and see if it agrees with what you were expecting:
Testing
xpack.monitoring.cluster_uuid: OVERRIDE
tologstash.yml
configuration file.http://localhost:9600/_node/stats
"cluster_uuid: OVERRIDE"
logstash.yml
and comment out the setting in step 1cluster_uuid
does not exist.Questions
From reading the issue it seems like the only requested functionality is to add the key to the API response and not to modify the return in any other way. Is that understanding correct?